package com.hundsun.cprs.yyt.service.account.enums;

import java.util.HashMap;
import java.util.Map;

public enum EnumQuotaTransType {

    //支出
    TRANS_0101("0101","交易支出"),
    TRANS_0102("0102","手工划出"),
    TRANS_0103("0103","积分兑换"),

    //收入
    TRANS_0201("0201","交易收入"),
    TRANS_0202("0202","手工划入"),

    //冻结
    TRANS_0301("0301","交易冻结"),
    TRANS_0302("0302","手工冻结"),

    //解冻
    TRANS_0401("0401","交易解冻"),
    TRANS_0402("0402","手工解冻");

    private String code;
    private String desc;
    
    private EnumQuotaTransType(String code ,String desc){
        this.code = code;
        this.desc = desc;
    }
    
    /**
     * 全局索引池
     */
    private static Map<String, EnumQuotaTransType> pool = new HashMap<String, EnumQuotaTransType>();
    static {
        for (EnumQuotaTransType et : EnumQuotaTransType.values()) {
            pool.put(et.code, et);
        }
    }
    
    /**
     * 根据内容索引
     * 
     * @param code
     * @return
     */
    public static EnumQuotaTransType indexByValue(String code) {
        return pool.get(code);
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static Map<String, EnumQuotaTransType> toMap(){
        return pool;
    }
}
